package sample.test.greenPages;

import BESA.util.ReportBESA;
import BESA.SystemLevel.AdmBESA;

public class Main_GreenPages {

    private static final String IP_ADD = "127.0.0.1";
    private static final int RMI_PORT = 9871;
    private static final String MC_ADD = "230.0.0.1";
    private static final int MC_PORT = 2222;

    public static void main(String[] args) {
        try {
            AdmBESA admLocal = AdmBESA.createInstance("Asma_2", 1.0, IP_ADD,
                    RMI_PORT, MC_ADD, MC_PORT, true);
            admLocal.getGreenPagesHelper().registerSociety("SOCIEDAD_2");

            testSleep(5000);
            admLocal.getGreenPagesHelper().printGreenPages();


        } catch (Exception e) {
            ReportBESA.error("[main] " + e.getMessage());
            System.out.println("poo noooo");
        }
    }// fin main

    private static void testSleep(long m) {
        try {
            Thread.sleep(m);
        } catch (InterruptedException ie) {
            ReportBESA.error("[main]" + ie.getMessage());
        }
    }
}
